<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
    <head>
        <%@include file="../common/head.jspf" %>
    </head>

    <body class="loan-detail-page gallery-page sb-l-o sb-r-c sb-l-o" data-menu="#menu_loan" data-list="#li_loan_list">

        <!-- 主体内容开始 -->
        <div id="main">

            <!--侧边导航栏-->
            <%@include file="../common/sidebar.jspf" %>

            <!-- Start: Content-Wrapper -->
            <section id="content_wrapper">

                <!-- 顶部导航 -->
                <header id="topbar">
                    <div class="topbar-left">
                        <ol class="breadcrumb">
                            <li class="crumb-active">
                                <span>软擎科技</span>
                            </li>
                            <li class="crumb-icon">
                                <a href="dashboard"><span class="glyphicon glyphicon-home"></span></a>
                            </li>
                            <!-- 当前页 -->
                            <li class="crumb-trail">标的还款计划</li>
                        </ol>
                    </div>
                    <div class="topbar-right">
                        <!-- 登录信息 -->
                        <%@include file="../common/session.jspf" %>
                    </div>
                </header>
                <!-- 顶部导航结束 -->

                <!-- 页面内容开始 -->
                <section id="content" class="p15">
                    <div id="loan" data-id="${model.id}" data-status="${model.status}" data-loantime="${model.loanTime}" class="hidden"></div>

                    <%@include file="common/nav.jspf" %>
                    <hr class="br-light mt10 mb10" />

                    <!--还款计划表-->
                    <div class="panel mn">
                        <div class="panel-body pn">
                            <table class="table table-striped table-text-center" id="repayTable">
                                <thead>
                                    <tr>
                                        <th></th>
                                        <th>还款期数</th>
                                        <th>应还总额</th>
                                        <th>应还本金</th>
                                        <th>应还利息</th>
                                        <th>剩余本金</th>
                                        <th>截止日期</th>
                                        <th>实际还款金额</th>
                                        <th>实际还款日期</th>
                                        <th>状态</th>
                                    </tr>
                                </thead>
                                <tbody id="repayContainer">
                                    <tr>
                                        <td colspan="10"><div class="fs16 text-muted mt30 mb30 text-center load-info"><span class="fa fa-spin fa-spinner mr10"></span>加载中 ..</div></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </section>
                <!-- 页面内容结束 -->
            </section>
        </div>
        <!-- 主体内容结束 -->

        <script type="text/x-tmpl-mustache" id="investRepayTemplate">
            <table class="table table-striped table-text-center">
                <thead>
                    <tr>
                        <th>还款对象</th>
                        <th>应还金额</th>
                        <th>应还本金</th>
                        <th>应还利息</th>
                        <th>实际还款金额</th>
                        <th>还款人</th>
                    </tr>
                </thead>
                <tbody>
                    {{#result}}
                        <tr>
                        <td><a href="user/index/{{repay.userId}}" target="_blank">{{userLoginName}}</a></td>
                        <td>{{repay.repayment.total}}</td>
                        <td>{{repay.repayment.principal}}</td>
                        <td>{{repay.repayment.interest}}</td>
                        <td>{{repay.repayAmount}}</td>
                        <td><a href="user/index/{{repay.repaySource.objectId}}" target="_blank">{{repaySourceName}}</a></td>
                        </tr>
                    {{/result}}
                </tbody>
            </table>
        </script>
        <script type="text/x-tmpl-mustache" id="investRepayPlanTemplate">
            {{#repayments}}
                <tr>
                    <td></td>
                    <td>{{index}}</td>
                    <td>{{total}}</td>
                    <td>{{principal}}</td>
                    <td>{{interest}}</td>
                    <td>{{outstanding}}</td>
                    <td>{{getDueDate}}</td>
                    <td>-</td>
                    <td>-</td>
                    <td>-</td>
                </tr>
            {{/repayments}}
        </script>
        
        <!-- 公共函数 -->
        <%@include file="../common/scripts.jspf" %>
        <script src="${rootPath}/js/pages/bill/repays.js" type="text/javascript"></script>
    </body>
</html>
